<!--
  前台用户管理: 可以添加一个冻结用户的功能
-->
<script>
export default {
  name: "UserSetting",
  data() {
    return {
      userInputValue: '',
      userSelectValue: '-1',
      userData: [],
    }
  },
  created() {
    this.findAllUser()
  },
  methods: {
    findAllUser() {
      this.$http.get('/user/findAllUser').then(res => {
        res.data.forEach(item => {
          item.userPhone === null ? item.userPhone = "未绑定" : item.userPhone;
          item.userEmail === null ? item.userEmail = "未绑定" : item.userEmail;
        })
        this.userData = res.data;
      })
    },
  }
}
</script>

<template>
  <div>
    <el-row>
      <el-col :span="21">
        用户：
        <!--        <el-input v-model="orderInputValue" @change="orderInput()" placeholder="输入你要查询的用户编号"-->
        <!--                  style="width: 250px;display: inline-block"/>-->
        <!--        <el-button @click="orderInputValue='';orderInput()" style="display: inline-block">清空</el-button>-->
      </el-col>
      <el-col :span="3">
        <!--        <el-select v-model="userSelectValue" style="width: 150px;" @change="findAllOrder()">-->
        <!--          <el-option label="全部" value="-1"/>-->
        <!--          <el-option label="正常用户" value="1"/>-->
        <!--          <el-option label="冻结账号" value="0"/>-->
        <!--        </el-select>-->
      </el-col>
    </el-row>


    <el-table :data="userData" style="width: 100%">
      <el-table-column prop="userId" label="用户编号" width="120"/>
      <el-table-column prop="userName" label="用户名" width="100"/>
      <el-table-column prop="userPhone" label="用户手机号" width="180"/>
      <el-table-column prop="userEmail" label="用户邮箱" width="100"/>
      <!--      <el-table-column label="帐号状态">-->
      <!--        <template #default="scope">-->
      <!--          <span v-if="scope.row.userStatus===1">正常用户</span>-->
      <!--          <span v-else>已冻结</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <!--      <el-table-column label="操作">-->
      <!--        <template #default="scope">-->
      <!--          <el-button v-if="scope.row.orderStatus===1" @click="faHuo(scope.row)">发货</el-button>-->
      <!--          <span v-else-if="scope.row.orderStatus===2">无</span>-->
      <!--          <span v-else-if="scope.row.orderStatus===3">已发货</span>-->
      <!--          <span v-else-if="scope.row.orderStatus===4">已收货</span>-->
      <!--          <span v-else>未支付</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
    </el-table>
  </div>
</template>

<style scoped>

</style>